package com.dogdog.util;

import com.dogdog.bean.Status;

import android.content.Context;
import android.widget.Toast;

public class ToastTool {
    public static void show(Context con,String m){
    	Toast.makeText(con,m,0).show();
    }
    
	//显示请求结果的提示工具
    public static void status(Context con,Status s){
    	switch (s.getState()) {
		case 1:
			ToastTool.show(con,"操作成功");
			break;
		case 2:
			ToastTool.show(con,"缺少参数");
			break;
		case 8:
			ToastTool.show(con,"请先登录");
			break;
		case 9:
			ToastTool.show(con,"没有这项权限");
			break;
		case 10:
			ToastTool.show(con,"登录失败，检查密码是否正确");
			break;
		default:
			ToastTool.show(con,"status:"+s.getState()+s.getMessage());
			break;
		}
    } 
    
}
